package top.scauwlt.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import top.scauwlt.Hello;
import top.scauwlt.HelloService;
import top.scauwlt.annotation.RpcReference;

/**
 * @Author wmm
 * @Date 2022/7/28 23:03
 */
@Controller("/")
public class HelloController {
    @RpcReference(version = "1.0", group = "message")
    private HelloService helloService;

    @GetMapping("/hello")
    @ResponseBody
    public String hello(String message, String description) {
        Hello hello = new Hello(message, description);
        helloService.hello(hello);
        return hello.toString();
    }
}
